# linux-amd环境下编译
build-linux-amd:
	rm -rf goblin
	CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o goblin

# linux-arm环境下编译
build-linux-arm:
	rm -rf goblin
	CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o goblin

# mac-amd环境下编译
build-mac-amd:
	rm -rf goblin
	CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -o goblin

# mac-arm环境下编译
build-mac-arm:
	rm -rf goblin
	CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -o goblin

# supervisor 默认配置路径
# --spvconf /etc/supervisor/conf.d
deploy79:
	@echo "正在部署服务到192.168.110.79..."
	./goblin --host 192.168.110.79 --user root --password root123 --name test --bin test

# 指定 服务上传路径
# --path /opt/app （默认上传路径）
deploy80:
	@echo "正在部署服务到192.168.110.80..."
	./goblin --host 192.168.110.80 --user root --password root123 --name test --bin test --path /opt/app

# 指定 supervisor 配置路径
# --spvconf /etc/supervisor/supervisord.d
deploy81:
	@echo "正在部署服务到192.168.110.81..."
	./goblin --host 192.168.110.81 --user root --password root123 --name test --bin test --spvconf /etc/supervisor/supervisord.d